﻿@model SelfMadeMillionaire.Web.Infrastructure.ViewModels.Account.LoginViewModel
@{
	ViewBag.Title = "Login";
}

@if (Model != null && Model.Token.HasValue)
{
    <div id="not-activated-dialog" style="display:none">
                    Your account email has not yet been confirmed. Please find account activation email (check your spam folder as well) and click on the link in the body of that email.<br /><br />
    Click @Html.ActionLink("HERE", "SendActivationEmail", new { token = Model.Token.Value.ToString() }) to resend the activation email.
    </div>
}

<div class="row">
	<div class="col-sm-12 col-md-12 col-lg-12">

		<!--left content block-->
		<div class="left_col_block">
			<div class="content_block_title">
				<h5>Login</h5>
				<div class="title_bottom_arrow">
					<img src="@Url.Content("~/Content/images/down_arrow.png")" alt="" />
				</div>
			</div>

			<!--subcribe-->
			<div class="biography_container">
				@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
				{
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tbody>
                            <tr>
                                <td colspan="2" style="padding-left: 55px !important;">
                                    @Html.AntiForgeryToken()
                                    @Html.HiddenFor(m => m.ReturnUrl)
                                    @Html.ValidationSummary(true)
                                </td>
                            </tr>
							<tr>
								<td valign="top" width="60%" style="padding-left: 40px !important;">
									<div class="form-group">
                                        @Html.LabelFor(m => m.Email, new { @class = "col-sm-3 control-label custom_label" })
										<div class="col-sm-6">
                                            @Html.TextBoxFor(m => m.Email, new { @class = "form-control", placeholder="Enter your email" })
								            @Html.ValidationMessageFor(m => m.Email)
										</div>
									</div>

									<div class="form-group">
										@Html.LabelFor(m => m.Password, new {@class = "col-sm-3 control-label custom_label"})
										<div class="col-sm-6">
											@Html.PasswordFor(m => m.Password, new { @class = "form-control", placeholder="Enter your password" })
								            @Html.ValidationMessageFor(m => m.Password)
										</div>
									</div>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<div class="newsletter_search_btn">
									    <button type="submit" class="btn btn-primary" style="margin-left:250px">Login</button>
                                        @Html.ActionLink("Forgot password?", "PasswordRecovery", "Account", null, new { @class = "btn btn-primary" })
								    </div>
								</td>
							</tr>

						</tbody>

					</table>
        					
				}
			</div>

		</div>
	</div>
</div>

@if (Model != null && Model.Token.HasValue)
{
    <script>
        $('#not-activated-dialog').dialog({
            modal: true,
            width: 500,
            resizable: false,
            buttons: [
              {
                  text: "Close",
                  click: function() {
                      $( this ).dialog( "close" );
                  }
              }
            ]
        });

        $('#not-activated-dialog').dialog("open");
    </script>
}